#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style>

</style>
#end

#define js()
<script>
    layui.use('upload', function(){
        var upload = layui.upload;

        //执行实例
        var uploadInst = upload.render({
            elem: '#upLicenses' //绑定元素
            ,accept:'file'
            ,acceptMime:'text/plain'
            ,exts:'lic',
            size:'1'
            ,url: '#(ctxPath)/uploadLicenses' //上传接口
            ,done: function(res){
                //上传完毕回调
                layer.msg(res.msg);
                setTimeout(function () {
                    top.window.location.href="/";
                },2000);
            }
            ,error: function(){
                //请求异常回调
                layer.msg("请求异常！");
            }
        });

        $("#getSN").click(function () {
            $.ajax ({
                type: 'POST',
                url: '#(ctxPath)/getSN',
                data: {},
                loadFlag: true,
                success : function(data){
                    layer.alert(data.msg);
                }
            });
            return false;
        });
    });
</script>
#end

#define content()
<div class="layui-fluid">
    <div class="layui-main">
        <ul class="site-idea">
            <li>
                <fieldset class="layui-elem-field layui-field-title">
                    <legend>License过期</legend>
                    <p>尊敬的客户您好！</p >
                    <p style="text-indent: 2em">您的授权已经过期，请联系XXXX公司支持人员获取License文件。</p >
                    <p>联系电话：027-88888888</p >
                </fieldset>
            </li>
        </ul>
        <div style="text-align: center"><a class="layui-btn" id="getSN">生成SN号</a></div>
        <ul class="site-idea">
            <button type="button" class="layui-btn" id="upLicenses">
                <i class="layui-icon">&#xe67c;</i>导入License文件
            </button>
        </ul>
    </div>

</div>
#end